<div bsModal #createOrEditModal="bs-modal" (onShown)="onShown()" class="modal fade" tabindex="-1" role="dialog"
    aria-labelledby="createOrEditModal" aria-hidden="true" [config]="{ backdrop: 'static', keyboard: !saving }">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <form *ngIf="active" #userForm="ngForm" novalidate (ngSubmit)="save()" autocomplete="off">
                <div class="modal-header">
                    <h4 class="modal-title">
                        <span *ngIf="task.id">编辑任务: {{ task.code }}</span>
                        <span *ngIf="!task.id">创建任务</span>
                    </h4>
                    <button type="button" class="close" (click)="close()" [attr.aria-label]="l('Close')"
                        [disabled]="saving">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body">

                    <div class="row">
                        <div class="col-md-2">
                            <label for="Code">任务号 *</label>
                        </div>
                        <div class="form-group col-md-4">
                            <input id="Code" #codeInput="ngModel" class="form-control" type="text" name="Code"
                                [(ngModel)]="task.code" required maxlength="32" />
                            <validation-messages [formCtrl]="codeInput"></validation-messages>
                        </div>
                        <div class="col-md-2">
                            <label for="DisplayName">任务名称 *</label>
                        </div>
                        <div class="form-group col-md-4">
                            <input id="DisplayName" #nameInput="ngModel" type="text" name="DisplayName"
                                class="form-control" [(ngModel)]="task.displayName" required maxlength="32" />
                            <validation-messages [formCtrl]="nameInput"></validation-messages>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-2">
                            <label for="PicNo">图号 *</label>
                        </div>
                        <div class="form-group col-md-4">
                            <input id="PicNo" #picNoInput="ngModel" type="text" name="PicNo" class="form-control"
                                [(ngModel)]="task.picNo" required maxlength="256" />
                            <validation-messages [formCtrl]="picNoInput"></validation-messages>
                        </div>
                        <div class="col-md-2">
                            <label for="Model">型号 *</label>
                        </div>
                        <div class="form-group col-md-4">
                            <input id="Model" type="text" #modelInput="ngModel" name="Model" class="form-control"
                                [(ngModel)]="task.model" required maxlength="24" />
                            <validation-messages [formCtrl]="modelInput"></validation-messages>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-2">
                            <label for="Portion">部段 *</label>
                        </div>
                        <div class="form-group col-md-4">
                            <input id="Portion" #portionInput="ngModel" type="text" name="Portion" class="form-control"
                                [(ngModel)]="task.portion" required maxlength="32" />
                            <validation-messages [formCtrl]="portionInput"></validation-messages>
                        </div>
                        <div class="col-md-2">
                            <label for="Amount">数量 *</label>
                        </div>
                        <div class="form-group col-md-4">
                            <input id="Amount" type="text" #amountInput="ngModel" name="Amount" class="form-control"
                                [(ngModel)]="task.amount" required maxlength="24" />
                            <validation-messages [formCtrl]="amountInput"></validation-messages>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-2">
                            <label for="RequiredDate">交付日期</label>
                        </div>
                        <div class="form-group col-md-4">

                            <!-- <input
                                        id="RequiredDate"
                                        type="text"
                                        name="RequiredDate"
                                        class="form-control"
                                        [(ngModel)]="task.requiredDate"
                                        maxlength="24"
                                    /> -->

                            <input id="RequiredDate" type="text" #RequiredDate name="RequiredDate" class="form-control"
                                [(ngModel)]="task.requiredDate" bsDatepicker>

                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-2">
                            <label for="Explain">备注</label>
                        </div>
                        <div class="form-group col-md-10">

                            <input id="Explain" type="text" name="Explain" class="form-control"
                                [(ngModel)]="task.explain" maxlength="300" />
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button [disabled]="saving" type="button" class="btn btn-default" (click)="close()">
                        取消
                    </button>
                    <button type="submit" class="btn btn-primary" [disabled]="!userForm.form.valid"
                        [buttonBusy]="saving" [busyText]="l('SavingWithThreeDot')">
                        <span>保存</span>
                    </button>
                </div>
            </form>
        </div>
    </div>
</div>